<?php

// +---------------------------------------------+
// |     Copyright  2010 - 2018 InterPhoto       |
// |     http://www.weentech.com                 |
// |     This file may not be redistributed.     |
// +---------------------------------------------+


include('includes/InterPhoto.Core.php');

CheckAccess('allowlogin');


$smarty = new InterPhoto;

$pagenav = '<a href="'.GetUrl('index.php').'">'.$langs['home'].'</a> '.$langs['nav'].' <a href="'.GetUrl('mydesk.php').'">'.$langs['mydesk'].'</a>';


$userdata = $DB->query_first("
SELECT (select COUNT(*)  FROM " . TABLE_PREFIX . "images WHERE userid = '". $userinfo['userid'] ."') AS totalimages, 
(select COUNT(*) FROM " . TABLE_PREFIX . "images WHERE actived =0 AND userid = '". $userinfo['userid'] ."') AS noactiveimages;
");


$smarty->assign('images', $userdata['totalimages']);
$smarty->assign('noactiveimages', $userdata['noactiveimages']);


$smarty->assign('pagenav', $pagenav);
$smarty->assign('userinfo', $userinfo);
$smarty->assign('pagetitle', $langs['mydesk'] . ' - ' .$mainsettings['siteTitle']);

$smarty->interPlay('mydesk.tpl');

?>